﻿@{
    ViewBag.Title = "test";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var smartData = (olierFrm.MVC.SmartPage.SmartPageData)ViewData["data"];
    var dtUser = smartData.StdQuery.Tables["User"];
    var x = 1;
}
@section head{
<script type="text/javascript">
    $(document).ready(function () {
        $(".sel").click(function () {
            $("#userDtl").load("/test/dtl?id=" + $(this).attr("nid") + "&r=" + Math.random());
            return false;
        });
    });
</script>
    <script src="../../Scripts/olierScript.js" type="text/javascript"></script>
}
<fieldset>
    <legend>用户</legend>
    <table>
        <thead>
            <tr>
                <th>
                    操作
                </th>
                @{
                    for (int i = 0; i < dtUser.Columns.Count; i++)
                    {
                    <th>@dtUser.Columns[i].Caption
                    </th>
                    }
                }
            </tr>
        </thead>
        <tbody>
            @{
                for (int i = 0; i < dtUser.Rows.Count; i++)
                {
                <tr>
                    <td>
                        <a class="sel" href="" nid="@dtUser.Rows[i]["nID"]">选择</a>
                    </td>

                    @{for (int j = 1; j < dtUser.Columns.Count; j++)
                      {
                        <td>@dtUser.Rows[i][j].ToString()
                        </td>
                      }
                    }
                </tr>
                }}
        </tbody>
    </table>
</fieldset>
<div id="userDtl"></div>